]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Only change opacity of minimized windows during transitions
authorSebastian Keller <skeller@gnome.org>
Mon, 17 May 2021 17:40:12 +0000 (19:40 +0200)
committerSebastian Keller <skeller@gnome.org>
Fri, 23 Jul 2021 10:38:12 +0000 (12:38 +0200)
Dragging a window preview in the overview is supposed to change the
opacity of the dragged actor. This however fails for minimized windows,
because Workspace::allocate() also changes the opacity of those. The
allocation gets triggered by removing the window actor from the
workspace when starting the drag. Avoid this by only changing the
opacity during the overview transitions.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4292

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1847>

js/ui/workspace.js

index fafa368ce75c4313cf021c56b541ec905efbe9b3..7e6018fbd3d9b01e545a40785cb058665f75829e 100644 (file)
@@ -627,8 +627,9 @@ var WorkspaceLayout = GObject.registerClass({
         }
 
         const { ControlsState } = OverviewControls;
-        const inSessionTransition =
-            this._overviewAdjustment.value <= ControlsState.WINDOW_PICKER;
+        const { currentState, transitioning } =
+            this._overviewAdjustment.getStateTransitionParams();
+        const inSessionTransition = currentState <= ControlsState.WINDOW_PICKER;
 
         const window = this._sortedWindows[0];
 
@@ -638,8 +639,8 @@ var WorkspaceLayout = GObject.registerClass({
             const [, bottomOversize] = window.chromeHeights();
             const [containerX, containerY] = containerBox.get_origin();
 
-            const extraHeightProgress = this._overviewAdjustment.value -
-                OverviewControls.ControlsState.WINDOW_PICKER;
+            const extraHeightProgress =
+                currentState - OverviewControls.ControlsState.WINDOW_PICKER;
 
             const extraClipHeight = bottomOversize * (1 - extraHeightProgress);
 
@@ -689,7 +690,8 @@ var WorkspaceLayout = GObject.registerClass({
                 workspaceBoxWidth = 0;
                 workspaceBoxHeight = 0;
 
-                child.opacity = stateAdjustementValue * 255;
+                if (transitioning)
+                    child.opacity = stateAdjustementValue * 255;
             }
 
             // Don't allow the scaled floating size to drop below